package com.zheng.upms.rpc.service.impl;

import com.zheng.common.annotation.BaseService;
import com.zheng.common.base.BaseServiceImpl;
import com.zheng.upms.dao.mapper.UpmsLogMapper;
import com.zheng.upms.dao.model.UpmsLog;
import com.zheng.upms.dao.model.UpmsLogExample;
import com.zheng.upms.rpc.api.UpmsLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * UpmsLogService实现
 * Created by shuzheng on 2017/3/20.
 *
 * UpmsLogServiceImpl extends BaseServiceImpl<UpmsLogMapper, UpmsLog, UpmsLogExample> implements UpmsLogService
 *
 * public abstract class BaseServiceImpl<Mapper, Record, Example> implements BaseService<Record, Example>
 *
 * 设计优雅，当初就像设计成这种模式，BaseServerImp和BaseService,当初不会用泛型，应当传入Mapper,和实体类，
 * UpmsLogExample是什么？
 *  sql语句实体类
 *          DynamicDataSource.setDataSource(DataSourceEnum.MASTER.getName());
 * 			Method deleteByExample = mapper.getClass().getDeclaredMethod("deleteByExample", example.getClass());
 * 			Object result = deleteByExample.invoke(mapper, example);//回调函数，传入执行sql的mapper和语句
 */
@Service
@Transactional
@BaseService
public class UpmsLogServiceImpl extends BaseServiceImpl<UpmsLogMapper, UpmsLog, UpmsLogExample> implements UpmsLogService {

    private static final Logger LOGGER = LoggerFactory.getLogger(UpmsLogServiceImpl.class);

    @Autowired
    UpmsLogMapper upmsLogMapper;

}